package com.miniapi.api;

import java.io.IOException;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

import ybl.wechat.ApiException;
import ybl.wechat.WeChatService;

import io.sentry.spring.jakarta.tracing.SentrySpan;
import io.sentry.Sentry;

@SpringBootApplication
@ComponentScan(basePackages = { "com.miniapi.api" })
public class ApiApplication {

	@SentrySpan
	public static void main(String[] args) throws ApiException, IOException {
		try {
			System.setProperty("file.encoding", "UTF-8");
			WeChatService.createMenu();
			SpringApplication.run(ApiApplication.class, args);
		} catch (Exception e) {
			Sentry.captureException(e);
		}
	}
}
